package javafx.com;

import java.net.URL;

import javafx.application.Application;
import javafx.application.HostServices;
import javafx.scene.Cursor;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;

public class main extends Application {

	public static void main(String[] args) {
		launch(args);
	}
	
	@Override
	public void start(Stage primaryStage) throws Exception {
		
		// 程序运行到此处使,跳转网页
		HostServices hostServices = getHostServices();
		hostServices.showDocument("www.baidu.com");
		
		
		URL url = getClass().getClassLoader().getResource("icon/5.png");
		String string = url.toString();
		
		Button button = new Button("按钮");
		
		button.setCursor(Cursor.DISAPPEAR);
		
		// 设置按钮高度--->无效==>设置为根节点后,会随之屏幕增大而增大
		button.setPrefWidth(200);
		button.setPrefHeight(200);
		
		// 设置group使之生效,原因暂未知
		Group group = new Group();
		group.getChildren().add(button);
		
		Scene scene = new Scene(group);
		
		// 设置鼠标形状,该节点范围内
//		scene.setCursor(Cursor.CLOSED_HAND);
		scene.setCursor(Cursor.cursor(string));
		
		primaryStage.setScene(scene);
		
		primaryStage.setTitle("javafx07");
		primaryStage.setHeight(400);
		primaryStage.setWidth(400);
		
		primaryStage.show();

	}
	
	

}
